package c2.cross.business.ladder.common;

import cate.game.play.part.PlaySide;
import cate.game.pvp.ladder.common.LadderOppoSnapshot;
import cate.game.role.RoleSnapshot;
import cate.game.role.show.avatar.AvatarVO;
import easy.java.dev.note.NoteField;
import lombok.ToString;

@ToString(callSuper = true)
/** 跨服天体对手全量信息 */
public class LadderOppoDetail extends LadderOppoSnapshot {

    @NoteField(value = "机器人使用的PlaySide引用ID", detail = "来自于LadderRobotPlaySidePool, 玩家没有这个值")
    public int robotPsId;

    @NoteField(value = "玩家的PlaySide")
    public PlaySide rolePs;

    public static final String COLLECTION = "ladder-oppo-rank";

    public LadderOppoSnapshot toSnapshot() {
        LadderOppoSnapshot snapshot = new LadderOppoSnapshot();
        snapshot.read(this);
        return snapshot;
    }

    public RoleSnapshot toRoleSnapshot() {
        RoleSnapshot s = new RoleSnapshot();
        s.initialize();
        s.unreal = this.robot;
        s.uid = this.id;
        s.base.power = this.power;
        s.base.uid = this.id;
        s.base.name = this.name;
        s.base.srvId = this.srvId;
        s.base.avatar = new AvatarVO();
        s.base.avatar.tid = this.avatarTid;
        return s;
    }

}
